Post

Replies

Boosts

Views

Activity

Reply to CloudKit JS and Many-To-Many relationships
I want to get a list of all component records which are inputComponents or outputComponents to the actor. Below I first fetch all CD_Components belonging to a CD_Project. Next I fetch all CD_Actors belonging to that same CD_Project. And next I want to get the CD_Components which are inputComponents or outputComponents from a CD_Actor and I'm looking for the code on how to do this. const componentQuery = { recordType: "CD_Component", filterBy: [{ fieldName: 'CD_project', comparator: 'EQUALS', fieldValue: {value: projectId} }], }; try { const response = await database.performQuery(componentQuery); if (response.hasErrors) { console.error("Query Errors:", response.errors); setError("Error fetching records"); } else { components = response.records; console.log(response.records); } } catch (err) { console.error("Error during query:", err); } const actorQuery = { recordType: "CD_Actor", filterBy: [{ fieldName: 'CD_project', comparator: 'EQUALS', fieldValue: {value: projectId} }], }; try { const response = await database.performQuery(actorQuery); if (response.hasErrors) { console.error("Query Errors:", response.errors); setError("Error fetching records"); } else { actors = response.records; console.log(response.records); } } catch (err) { console.error("Error during query:", err); }
Topic: Safari & Web SubTopic: General Tags:
Mar ’26
Reply to CloudKit JS and Many-To-Many relationships
I want to get a list of all component records which are inputComponents or outputComponents to the actor. Below I first fetch all CD_Components belonging to a CD_Project. Next I fetch all CD_Actors belonging to that same CD_Project. And next I want to get the CD_Components which are inputComponents or outputComponents from a CD_Actor and I'm looking for the code on how to do this. const componentQuery = { recordType: "CD_Component", filterBy: [{ fieldName: 'CD_project', comparator: 'EQUALS', fieldValue: {value: projectId} }], }; try { const response = await database.performQuery(componentQuery); if (response.hasErrors) { console.error("Query Errors:", response.errors); setError("Error fetching records"); } else { components = response.records; console.log(response.records); } } catch (err) { console.error("Error during query:", err); } const actorQuery = { recordType: "CD_Actor", filterBy: [{ fieldName: 'CD_project', comparator: 'EQUALS', fieldValue: {value: projectId} }], }; try { const response = await database.performQuery(actorQuery); if (response.hasErrors) { console.error("Query Errors:", response.errors); setError("Error fetching records"); } else { actors = response.records; console.log(response.records); } } catch (err) { console.error("Error during query:", err); }
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Mar ’26